<template>
	<div class="container">
		<div class="info">
			<!-- <div v-if="indent == '养殖场账号'" style="height: 20px;"></div> -->
			<div v-if="indent == '养殖场账号'" style="padding: 10px;width: 90%;margin-left: 5%;" @click="appOint">
				<div style="display: flex;align-items: center;justify-content: space-between;">
					<div class="flex-image" style="display: flex;align-items: center;">
						<image
							src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%202368.png" />
						<div style="width: 15px;"></div>
						<div>预约中心</div>
					</div>
					<div style="display: flex;align-items: center;">
						<u-icon color="#000000" name="arrow-right"></u-icon>
						<div style="width: 10px;"></div>
					</div>
				</div>
			</div>
			<div v-if="indent == '养殖场账号'" style="height: 20px;"></div>
			<div v-if="indent == '养殖场账号'" style="padding: 10px;width: 90%;margin-left: 5%;" @click="goFeesIndex">
				<div style="display: flex;align-items: center;justify-content: space-between;">
					<div class="flex-image" style="display: flex;align-items: center;">
						<image
							src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%202406.png" />
						<div style="width: 15px;"></div>
						<div>缴费管理</div>
					</div>
					<div style="display: flex;align-items: center;">
						<u-icon color="#000000" name="arrow-right"></u-icon>
						<div style="width: 10px;"></div>
					</div>
				</div>
			</div>
			<div v-if="indent == '养殖场账号'" style="height: 20px;"></div>
			<div v-if="indent == '养殖场账号'" style="padding: 10px;width: 90%;margin-left: 5%;" @click="driver">
				<div style="display: flex;align-items: center;justify-content: space-between;">
					<div class="flex-image" style="display: flex;align-items: center;">
						<image
							src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%202405.png" />
						<div style="width: 15px;"></div>
						<div>司机管理</div>
					</div>
					<div style="display: flex;align-items: center;">
						<u-icon color="#000000" name="arrow-right"></u-icon>
						<div style="width: 10px;"></div>
					</div>
				</div>
			</div>
			<div v-if="indent == '养殖场账号'" style="height: 20px;"></div>
			<div v-if="indent == '养殖场账号'" style="padding: 10px;width: 90%;margin-left: 5%;" @click="car">
				<div style="display: flex;align-items: center;justify-content: space-between;">
					<div class="flex-image" style="display: flex;align-items: center;">
						<image
							src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%202404.png" />
						<div style="width: 15px;"></div>
						<div>车辆管理</div>
					</div>
					<div style="display: flex;align-items: center;">
						<u-icon color="#000000" name="arrow-right"></u-icon>
						<div style="width: 10px;"></div>
					</div>
				</div>
			</div>
			<div v-if="indent == '养殖场账号'" style="height: 20px;"></div>
			<div v-if="indent == '养殖场账号'" style="padding: 10px;width: 90%;margin-left: 5%;" @click="message">
				<div style="display: flex;align-items: center;justify-content: space-between;">
					<div class="flex-image" style="display: flex;align-items: center;">
						<image
							src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%202403.png" />
						<div style="width: 15px;"></div>
						<div>信息管理</div>
					</div>
					<div style="display: flex;align-items: center;">
						<u-icon color="#000000" name="arrow-right"></u-icon>
						<div style="width: 10px;"></div>
					</div>
				</div>
			</div>
			<div v-if="indent == '养殖场账号'" style="height: 20px;"></div>
			<div v-if="indent == '养殖场账号'" style="padding: 10px;width: 90%;margin-left: 5%;" @click="goContractIndex">
				<div style="display: flex;align-items: center;justify-content: space-between;">
					<div class="flex-image" style="display: flex;align-items: center;">
						<image
							src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%202402.png" />
						<div style="width: 15px;"></div>
						<div>签约管理</div>
					</div>
					<div style="display: flex;align-items: center;">
						<u-icon color="#000000" name="arrow-right"></u-icon>
						<div style="width: 10px;"></div>
					</div>
				</div>
			</div>
			<div v-if="indent == '处理厂司机'" style="height: 20px;"></div>
			<div v-if="indent == '处理厂司机'" style="padding: 10px;width: 90%;margin-left: 5%;" @click="goQuestIndex">
				<div style="display: flex;align-items: center;justify-content: space-between;">
					<div class="flex-image" style="display: flex;align-items: center;">
						<image
							src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%202368.png" />
						<div style="width: 15px;"></div>
						<div>待处理任务</div>
					</div>
					<div style="display: flex;align-items: center;">
						<u-icon color="#000000" name="arrow-right"></u-icon>
						<div style="width: 10px;"></div>
					</div>
				</div>
			</div>
			<div v-if="indent == '处理厂司机'" style="height: 20px;"></div>
			<div v-if="indent == '处理厂司机'" style="padding: 10px;width: 90%;margin-left: 5%;" @click="goQuest('历史记录')">
				<div style="display: flex;align-items: center;justify-content: space-between;">
					<div class="flex-image" style="display: flex;align-items: center;">
						<image
							src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%2018.png" />
						<div style="width: 15px;"></div>
						<div>历史记录</div>
					</div>
					<div style="display: flex;align-items: center;">
						<u-icon color="#000000" name="arrow-right"></u-icon>
						<div style="width: 10px;"></div>
					</div>
				</div>
			</div>
			<div v-if="indent == '处理厂司机'" style="height: 20px;"></div>
			<div v-if="indent == '处理厂司机'" style="padding: 10px;width: 90%;margin-left: 5%;" @click="carStop">
				<div style="display: flex;align-items: center;justify-content: space-between;">
					<div class="flex-image" style="display: flex;align-items: center;">
						<image
							src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%202394.png" />
						<div style="width: 15px;"></div>
						<div>车辆状态</div>
					</div>
					<div style="display: flex;align-items: center;">
						<u-icon color="#000000" name="arrow-right"></u-icon>
						<div style="width: 10px;"></div>
					</div>
				</div>
			</div>
			<div v-if="indent == '处理厂司机'" style="height: 20px;"></div>
			<div v-if="indent == '处理厂司机'" style="padding: 10px;width: 90%;margin-left: 5%;" @click="computed">
				<div style="display: flex;align-items: center;justify-content: space-between;">
					<div class="flex-image" style="display: flex;align-items: center;">
						<image
							src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%202384.png" />
						<div style="width: 15px;"></div>
						<div>油耗计算</div>
					</div>
					<div style="display: flex;align-items: center;">
						<u-icon color="#000000" name="arrow-right"></u-icon>
						<div style="width: 10px;"></div>
					</div>
				</div>
			</div>
			<div v-if="role == '调度员'" style="height: 20px;"></div>
			<div v-if="role == '调度员'" style="padding: 10px;width: 90%;margin-left: 5%;" @click="task('任务管理')">
				<div style="display: flex;align-items: center;justify-content: space-between;">
					<div class="flex-image" style="display: flex;align-items: center;">
						<image
							src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%202359.png" />
						<div style="width: 15px;"></div>
						<div>任务管理</div>
					</div>
					<div style="display: flex;align-items: center;">
						<u-icon color="#000000" name="arrow-right"></u-icon>
						<div style="width: 10px;"></div>
					</div>
				</div>
			</div>
			<div v-if="role == '调度员'" style="height: 20px;"></div>
			<div v-if="role == '调度员'" style="padding: 10px;width: 90%;margin-left: 5%;" @click="task('历史记录')">
				<div style="display: flex;align-items: center;justify-content: space-between;">
					<div class="flex-image" style="display: flex;align-items: center;">
						<image
							src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%2018.png" />
						<div style="width: 15px;"></div>
						<div>历史记录</div>
					</div>
					<div style="display: flex;align-items: center;">
						<u-icon color="#000000" name="arrow-right"></u-icon>
						<div style="width: 10px;"></div>
					</div>
				</div>
			</div>
			<div v-if="role == '调度员'" style="height: 20px;"></div>
			<div v-if="role == '调度员'" style="padding: 10px;width: 90%;margin-left: 5%;" @click="wagon">
				<div style="display: flex;align-items: center;justify-content: space-between;">
					<div class="flex-image" style="display: flex;align-items: center;">
						<image
							src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%202384.png" />
						<div style="width: 15px;"></div>
						<div>模拟地磅</div>
					</div>
					<div style="display: flex;align-items: center;">
						<u-icon color="#000000" name="arrow-right"></u-icon>
						<div style="width: 10px;"></div>
					</div>
				</div>
			</div>
			
			<div v-if="indent == '任务发布实验员'" style="height: 20px;"></div>
			<div v-if="indent == '任务发布实验员'" style="padding: 10px;width: 90%;margin-left: 5%;" @click="goQuest('历史记录')">
				<div style="display: flex;align-items: center;justify-content: space-between;">
					<div class="flex-image" style="display: flex;align-items: center;">
						<image
							src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%2018.png" />
						<div style="width: 15px;"></div>
						<div>我的任务</div>
					</div>
					<div style="display: flex;align-items: center;">
						<u-icon color="#000000" name="arrow-right"></u-icon>
						<div style="width: 10px;"></div>
					</div>
				</div>
			</div>
			<div v-if="indent == '任务发布实验员'" style="height: 20px;"></div>
			<div v-if="indent == '任务发布实验员'" style="padding: 10px;width: 90%;margin-left: 5%;" @click="carStop">
				<div style="display: flex;align-items: center;justify-content: space-between;">
					<div class="flex-image" style="display: flex;align-items: center;">
						<image
							src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%202394.png" />
						<div style="width: 15px;"></div>
						<div>数据管理</div>
					</div>
					<div style="display: flex;align-items: center;">
						<u-icon color="#000000" name="arrow-right"></u-icon>
						<div style="width: 10px;"></div>
					</div>
				</div>
			</div>
			<div v-if="indent == '任务发布实验员'" style="height: 20px;"></div>
			<div v-if="indent == '任务发布实验员'" style="padding: 10px;width: 90%;margin-left: 5%;" @click="computed">
				<div style="display: flex;align-items: center;justify-content: space-between;">
					<div class="flex-image" style="display: flex;align-items: center;">
						<image
							src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%202384.png" />
						<div style="width: 15px;"></div>
						<div>设备管理</div>
					</div>
					<div style="display: flex;align-items: center;">
						<u-icon color="#000000" name="arrow-right"></u-icon>
						<div style="width: 10px;"></div>
					</div>
				</div>
			</div>
			<div style="height: 20px;"></div>
			<div style="padding: 10px;width: 90%;margin-left: 5%;" @click="report">
				<div style="display: flex;align-items: center;justify-content: space-between;">
					<div class="flex-image" style="display: flex;align-items: center;">
						<image
							src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%202385.png" />
						<div style="width: 15px;"></div>
						<div>年度报告</div>
					</div>
					<div style="display: flex;align-items: center;">
						<u-icon color="#000000" name="arrow-right"></u-icon>
						<div style="width: 10px;"></div>
					</div>
				</div>
			</div>
			<div style="height: 20px;"></div>
			<div style="padding: 10px;width: 90%;margin-left: 5%;" @click="helpNav">
				<div style="display: flex;align-items: center;justify-content: space-between;">
					<div class="flex-image" style="display: flex;align-items: center;">
						<image
							src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%2021.png"
							mode="scaleToFill" />

						<div style="width: 15px;"></div>
						<div>操作帮助</div>
					</div>
					<div style="display: flex;align-items: center;">
						<u-icon color="#000000" name="arrow-right"></u-icon>
						<div style="width: 10px;"></div>
					</div>
				</div>
			</div>

			<div style="height: 20px;"></div>
			<div style="padding: 10px;width: 90%;margin-left: 5%;" @click="set">
				<div style="display: flex;align-items: center;justify-content: space-between;">
					<div class="flex-image" style="display: flex;align-items: center;">
						<image
							src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%2023.png" />
						<div style="width: 15px;"></div>
						<div>个人设置</div>
					</div>
					<div style="display: flex;align-items: center;">
						<u-icon color="#000000" name="arrow-right"></u-icon>
						<div style="width: 10px;"></div>
					</div>
				</div>
			</div>
			<div style="height: 20px;"></div>
			<div style="padding: 10px;width: 90%;margin-left: 5%;" @click="NFC">
				<div style="display: flex;align-items: center;justify-content: space-between;">
					<div class="flex-image" style="display: flex;align-items: center;">
						<image
							src="https://28-1325662301.cos.ap-shanghai.myqcloud.com/%E9%9D%92%E5%B2%9B%E5%B0%8F%E7%A8%8B%E5%BA%8F%2FGroup%2023.png" />
						<div style="width: 15px;"></div>
						<div>NFC</div>
					</div>
					<div style="display: flex;align-items: center;">
						<u-icon color="#000000" name="arrow-right"></u-icon>
						<div style="width: 10px;"></div>
					</div>
				</div>
			</div>
			<div style="height: 5vh"></div>
		</div>

		<div style="height: 50px;"></div>
	</div>

	<!-- <tabBar :currentPage="currentPage" :indent="indent" :role="role"></tabBar> -->
</template>
<script>
import personalInfo from '../../pagesScreen/pagesCompontents/personal-info.vue'
import request from '../../common/request';
export default {
	components: {
		personalInfo
	},
	data() {
		return {
			role: '',//司机/养殖场账号/调度员/处理厂操作员
			currentPage: '',
			userInfo: {},
			indent: '',
			base: '',
			requestBase: request,
			request: '',
			avatar: ''
		}
	},
	methods: {
		// 任务管理
		task(i) {
			if (i == '历史记录') {
				uni.navigateTo({
					url: `/pagesDispatch/index/quest?flag=${i}`
				})
			} else {
				uni.navigateTo({
					url: `/pagesDispatch/index/tran`
				})
			}

		},
		NFC() {
            uni.navigateTo({
                url: '/pagesPlant/index/nfc'
            })
        },
		//模拟地磅
		wagon() {
			uni.navigateTo({ url: '/pagesFarmer/index/wagon' })
		},
		//帮助
		helpNav() {
            uni.navigateTo({ url: '/pagesDispatch/index/help' })
        },
		//预约中心
		appOint() {
			uni.navigateTo({
				url: '/pagesCopy/index/Appointmentrecords'
			})
		},
		// 司机管理 
		driver() {
			uni.navigateTo({ url: '/pagesFarmer/index/driver' })
		},
		//车辆管理
		car() {
			uni.navigateTo({ url: '/pagesFarmer/index/car' })
		},
		//信息管理
		message() {
			uni.navigateTo({ url: '/pagesFarmer/index/message' })
		},
		// 缴费管理
		goFeesIndex() {
			uni.navigateTo({
				url: '/pagesFarmer/index/feesIndex'
			})
		},
		// 合同管理
		goContractIndex() {
			uni.navigateTo({
				url: '/pagesFarmer/index/contractIndex'
			})
		},
		goQuest(i) {
			uni.navigateTo({
				url: `/pagesDriver/system/quest?flag=${i}`
			})
		},
		goQuestIndex() {
			uni.navigateTo({
				url: '/pagesDriver/system/questIndex'
			})
		},
		//油耗计算
		computed() {
			uni.navigateTo({
				url: '/pagesDriver/system/compute'
			})
		},
		//车辆报停
		carStop() {
			uni.navigateTo({
				url: '/pagesDriver/system/lookStop'
			})
		},
		// 跳转设置页面
		set() {
			uni.navigateTo({ url: '/pagesDriver/system/set' })
		},
		// 跳转年度报告
		report() {
			uni.navigateTo({ url: '/pagesDriver/system/reports' })
		},

	},
	onLoad() {

	},
	mounted() {
		this.userInfo = uni.getStorageSync('userInfo');
		this.avatar = uni.getStorageSync('userInfo').avatar;
		console.log(this.userInfo, 'userInfo');
		this.role = this.userInfo.remark;
		this.indent = uni.getStorageSync('pageIndent');
		uni.hideHomeButton();
		var pages = getCurrentPages();
		let currentPageRoute = pages[pages.length - 1].route;
		// 根据当前页面路径设置currentPage
		this.currentPage = currentPageRoute;
		console.log(this.currentPage);
		this.request = this.requestBase.config.baseURL;
	}

}
</script>
<style lang="scss">
// .container {
//     max-height: 91vh;
//     width: 100vw;
//     color: #000000;
//     font-weight: 500;
//     overflow-y: scroll;
//     background-color: #f2f8f5;
// }

// page {
//     background: #f2f8f5;
// }

.info {
	border-radius: 20px;
	width: 90%;
	margin-left: 5%;
}

.head-img image {
	width: 100rpx;
	height: 100rpx;
}

.flex-image image {
	width: 75rpx;
	height: 75rpx;
}

.line-white {
	height: 4rpx;
	width: 100vw;
	background: #eef3f1;
}
</style>